var http = require('http');
var url = require('url');

function start(route,handle){
    http.createServer(function(req,res){
        var pathname = url.parse(req.url).pathname;
        console.log("request for "+pathname+' received');
        route(handle,pathname,res);


    }).listen(8888)

    console.log('The server is running at port 8888')
}

exports.start = start;


